import type { RouteRecordRaw } from 'vue-router';
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      hidden: true
    }
  },

  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      hidden: true
    }
  },

  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    redirect: '/home',
    children: [{
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index.vue'),
      meta: {
        title: '首页',
        icon: 'ele-HomeFilled',
      }
    }]
  },
];

export const allAsyncRoutes:RouteRecordRaw[] = [
  // 商品管理 也是一个一级路由，包含了4个二级路由
  {
    path: '/product',
    name: 'Product', //这个名字代表命名路由，后期是要在权限控制当中去使用的，必须配而且名字必须固定，不能变
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '商品管理',
      icon: 'ele-Goods'
    },
    children: [
      {
        path: 'trademark/list',
        component: () => import('@/views/product/trademark/index.vue'),
        // 如果一级路由有菜单并且有图标和标题，那么二级路由只需要配置标题就可以了
        // 不需要配置图标
        meta: {
          title: '品牌管理'
        },
        name: 'Trademark'
      },
      {
        path: 'attr/list',
        component: () => import('@/views/product/attr/index.vue'),
        meta: {
          title: '平台属性管理'
        },
        name: 'Attr'
      },
      {
        path: 'sku/list',
        component: () => import('@/views/product/sku/index.vue'),
        meta: {
          title: 'Sku管理'
        },
        name: 'Sku'
      },
      {
        path: 'spu/list',
        component: () => import('@/views/product/spu/index.vue'),
        meta: {
          title: 'Spu管理'
        },
        name: 'Spu'
      },
      {
        path: 'scoped/list',
        component: () => import('@/views/product/scoped/index.vue'),
        meta: {
          title: 'Scoped测试'
        },
        name: 'Scoped'
      },
    ]
  },

  {
    path: "/acl",
    name: "Acl",
    component: () => import("@/layout/index.vue"),
    redirect: "/acl/user/list",
    meta: {
      title: "权限管理",
      icon: "ele-Setting",
    },
    children: [
      {
        name: "User",
        path: "/acl/user/list",
        component: () => import("@/views/acl/user/index.vue"),
        meta: {
          title: "用户管理",
        },
      },
      {
        name: "Role",
        path: "/acl/role/list",
        component: () => import("@/views/acl/role/index.vue"),
        meta: {
          title: "角色管理",
        },
      },
      {
        name: "RoleAuth",
        path: "/acl/role/auth",
        component: () => import("@/views/acl/role/roleAuth.vue"),
        meta: {
          title: "角色管理",
          hidden: true,
          activeMenu: "/acl/role/list",
        },
      },
      {
        name: "Permission",
        path: "/acl/permission/list",
        component: () => import("@/views/acl/permission/index.vue"),
        meta: {
          title: "菜单管理",
        },
      },
    ],
  },
  {
    path:'/test',
    name:'TestHaHa',
    component:()=>import('@/layout/index.vue'),
    meta:{
      icon:'ele-Lock',
      title:'测试管理'
    },
    children:[
      {
        path:'/test1/list',
        name:'Test111',
        component:()=>import('@/views/test/test1/index.vue'),
        meta:{title:'测试管理111'}
      },
      {
        path:'/test2/list',
        name:"Test222",
        component:()=>import('@/views/test/test2/index.vue'),
        meta:{title:'测试管理222'}
      }
    ]
  },
  {
    path:'/testAixleft',
    name:'TestAixleft',
    component:()=>import('@/layout/index.vue'),
    meta:{
      icon:'ele-Lock',
      title:'爱小左堡马X6'
    },
    children:[
      {
        path:'/testAixleft1/list',
        name:'TestAixleft1',
        component:()=>import('@/views/testAixleft/testAixleft1/index.vue'),
        meta:{title:'爱小左堡马X61'}
      },
      {
        path:'/testAixleft2/list',
        name:'TestAixleft2',
        component:()=>import('@/views/testAixleft/testAixleft2/index.vue'),
        meta:{title:'爱小左堡马X62'}
      }
    ]
  }
]

export const anyRoute:RouteRecordRaw =  /* 匹配任意的路由 必须最后注册 */
{
  path: '/:pathMatch(.*)',
  name: 'Any',
  redirect: '/404',
  meta: {
    hidden: true
  }
}


